import tkinter
import threading
import ctypes
class GUI:
    def __init__(self):
        self.tk = tkinter.Tk()
        self.tk.title("delete_gitee")
        self.tk.geometry("400x200")
        self.outtext=tkinter.Text(self.tk,width=400,height=200)
        self.outtext.pack()
        self.inlock = threading.Lock()
        self.outlock = threading.Lock()
        self.outline=0
        # 告诉操作系统使用程序自身的dpi适配
        ctypes.windll.shcore.SetProcessDpiAwareness(1)
        # 获取屏幕的缩放因子
        ScaleFactor = ctypes.windll.shcore.GetScaleFactorForDevice(0)
        # 设置程序缩放
        self.tk.call('tk', 'scaling', ScaleFactor / 75)
    def startgui(self):
        self.tk.mainloop()
    def outputgui(self,path):
        self.outlock.acquire()
        self.outtext.insert('insert', path+"\n")
        self.outtext.update()
        self.outlock.release()
    def outputcil(self,path):
        self.inlock.acquire()
        print(path)
        self.inlock.release()
    def input(self,path):
        self.inlock.acquire()
        a=input(path)
        self.inlock.release()
        return a

